Two dimensional arrays

int[][] mat = new int[3][4];

mat.length ---> # of rows
mat[0].length ---> # of columns

mat			RowAvgs
0	1	2	1.0
10	11	12	11.0
20	21	22	21.0

10.0	11.0	12.0	ColAvgs

We can rely on initializer lists to create a 2D array

Application#1: RowColAvgs.java

RowAvgs[0] = (mat[0][0] + mat[0][1] + ... + mat[0][COLS-1]) / COLS

RowAvgs[1] = (mat[1][0] + mat[1][1] + ... + mat[1][COLS-1]) / COLS

RowAvgs[row] = (mat[row][0] + mat[row][1] + ... + mat[row][COLS-1]) / COLS

= \sum_{col = 0}^{COLS-1}mat[row][col]

Outer loop to apply the formula to all the rows (Controlled by the row idx)
Inner loop collecting the elements from the different columns (Controlled by col idx)

- ArrayList ---> dynamic data structure

Size: number of elements that are present in the arraylist
Capacity: maximum of values we can store in it

int[] arr = new int[12];
vs
ArrayList is part java.util

ArrayList<Integer> list = new ArrayList<>();

Application#2: Beatles.java






